#include<stdio.h>

int printMultiplicationTable();
int diamond(int n, char c);

int main(int argc, char* argv[]) {
	printMultiplicationTable();
	diamond(7, '*');
	return 0;
}

int printMultiplicationTable(){
	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) {
			if (j > i) continue;
			printf("%d\t", i * j);
		}
		printf("\n");
	}
	return 0;
}
int diamond(int n, char c) {
	if (!(n % 2)) {
		printf("请输入奇数: %d", n);
		return -1;
	}
	int middle = n / 2 + 1;
	for (int i = 1; i <= n; i++) {
		if (i <= middle) {
			for(int j = 0, l = middle - i; j < l; j++) {
				printf("\t");
			}
			for (int j = 0, l = 2 * i -1; j < l; j++) {
				printf("%c\t", c);
			}
			printf("\n");
		} else {
			for(int j = 0, l = i - middle; j < l; j++) {
				printf("\t");
			}
			for(int j = 0, l = 2 * (n - i + 1) - 1; j < l; j++) {
				printf("%c\t", c);
			}
			printf("\n");
		}
	}
	return 0;
}
